<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Init Vue | Cying</title><meta name="keywords" content="Vue"><meta name="author" content="Cying-承影"><meta name="copyright" content="Cying-承影"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Cying, How To Create A Vue Project ?   前言Vue框架有两种使用方式：  1、一种是通过在HTML文件中引入 vue.js 的文件2、另一种是通过脚手架 vue-Cli 创建一个 vue 工程   今天我要介绍的就是第二种方式安装三个软件：VsCode，nodejs，cmder，其中 cmder 是用于代替 cmd ，非必须。点击名字跳转至下载   第一步：">
<meta property="og:type" content="article">
<meta property="og:title" content="Init Vue">
<meta property="og:url" content="http://cyingk.github.io/2019/12/12/Init_Vue/index.html">
<meta property="og:site_name" content="Cying">
<meta property="og:description" content="Cying, How To Create A Vue Project ?   前言Vue框架有两种使用方式：  1、一种是通过在HTML文件中引入 vue.js 的文件2、另一种是通过脚手架 vue-Cli 创建一个 vue 工程   今天我要介绍的就是第二种方式安装三个软件：VsCode，nodejs，cmder，其中 cmder 是用于代替 cmd ，非必须。点击名字跳转至下载   第一步：">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://img-blog.csdnimg.cn/20191211202933273.png">
<meta property="article:published_time" content="2019-12-11T16:51:53.000Z">
<meta property="article:modified_time" content="2020-02-15T18:16:07.000Z">
<meta property="article:author" content="Cying-承影">
<meta property="article:tag" content="Vue">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/20191211202933273.png"><link rel="shortcut icon" href="/img/favicon.ico"><link rel="canonical" href="http://cyingk.github.io/2019/12/12/Init_Vue/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//www.clarity.ms"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>(function(c,l,a,r,i,t,y){
    c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
    t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
    y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "4zndahq92q");</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: 'days',
  date_suffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"Traditional Chinese Activated Manually","cht_to_chs":"Simplified Chinese Activated Manually","day_to_night":"Dark Mode Activated Manually","night_to_day":"Light Mode Activated Manually","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isanchor: false
};

const saveToLocal = {
  // ttl 單位是 天
  set: function setWithExpiry(key, value, ttl) {
    if (ttl === 0) return
    const now = new Date()
    const expiryDay = ttl * 86400000
    const item = {
      value: value,
      expiry: now.getTime() + expiryDay,
    }
    localStorage.setItem(key, JSON.stringify(item))
  },

  get: function getWithExpiry(key) {
    const itemStr = localStorage.getItem(key)

    if (!itemStr) {
      return undefined
    }
    const item = JSON.parse(itemStr)
    const now = new Date()

    if (now.getTime() > item.expiry) {
      localStorage.removeItem(key)
      return undefined
    }
    return item.value
  }
}

// https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
const getScript = url => new Promise((resolve, reject) => {
  const script = document.createElement('script')
  script.src = url
  script.async = true
  script.onerror = reject
  script.onload = script.onreadystatechange = function() {
    const loadState = this.readyState
    if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
    script.onload = script.onreadystatechange = null
    resolve()
  }
  document.head.appendChild(script)
})</script><script id="config_change">var GLOBAL_CONFIG_SITE = { 
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2020-02-16 02:16:07'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(function () {  window.activateDarkMode = function () {
    document.documentElement.setAttribute('data-theme', 'dark')
    if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
    }
  }
  window.activateLightMode = function () {
    document.documentElement.setAttribute('data-theme', 'light')
   if (document.querySelector('meta[name="theme-color"]') !== null) {
      document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
    }
  }
  const autoChangeMode = '1'
  const t = saveToLocal.get('theme')
  if (autoChangeMode === '1') {
    const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
    const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
    const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
    const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
    if (t === undefined) {
      if (isLightMode) activateLightMode()
      else if (isDarkMode) activateDarkMode()
      else if (isNotSpecified || hasNoSupport) {
        const now = new Date()
        const hour = now.getHours()
        const isNight = hour <= 6 || hour >= 18
        isNight ? activateDarkMode() : activateLightMode()
      }
      window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
        if (saveToLocal.get('theme') === undefined) {
          e.matches ? activateDarkMode() : activateLightMode()
        }
      })
    } else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else if (autoChangeMode === '2') {
    const now = new Date()
    const hour = now.getHours()
    const isNight = hour <= 6 || hour >= 18
    if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
    else if (t === 'light') activateLightMode()
    else activateDarkMode()
  } else {
    if (t === 'dark') activateDarkMode()
    else if (t === 'light') activateLightMode()
  }const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
   if (asideStatus === 'hide') {
     document.documentElement.classList.add('hide-aside')
   } else {
     document.documentElement.classList.remove('hide-aside')
   }
}const fontSizeVal = saveToLocal.get('global-font-size')
if (fontSizeVal !== undefined) {
  document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
}})()</script><meta name="generator" content="Hexo 5.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">Loading...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" src="/img/avatar.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">23</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">Tags</div><div class="length-num">12</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">Categories</div><div class="length-num">3</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> Categories</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://5b0988e595225.cdn.sohucs.com/images/20190831/84729f5c5bb346208416445feb485df6.jpeg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Cying</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> Categories</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">Init Vue</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">Created</span><time class="post-meta-date-created" datetime="2019-12-11T16:51:53.000Z" title="Created 2019-12-12 00:51:53">2019-12-12</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2020-02-15T18:16:07.000Z" title="Updated 2020-02-16 02:16:07">2020-02-16</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/Blog/">Blog</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">Word count:</span><span class="word-count">468</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">Reading time:</span><span>1min</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">Post View:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><html><head></head><body><p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211202933273.png#pic_center" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211202933273.png#pic_center" class="lazyload"></a></p>
<center><h1>Cying, How To Create A Vue Project ?</h1></center>


<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>Vue框架有两种使用方式：</p>
<blockquote>
<p>1、一种是通过在HTML文件中引入 <a href="https://cn.vuejs.org/" target="_blank" rel="noopener"><code>vue.js</code></a> 的文件<br>2、另一种是通过脚手架 <code>vue-Cli</code> 创建一个 <a href="https://baike.baidu.com/item/Vue.js" target="_blank" rel="noopener"><code>vue</code></a> 工程</p>
</blockquote>
<blockquote>
<p>今天我要介绍的就是第二种方式<br>安装三个软件：<a href="https://code.visualstudio.com/docs/?dv=win" target="_blank" rel="noopener"><code>VsCode</code></a>，<a href="https://nodejs.org/dist/v12.13.1/node-v12.13.1-x64.msi" target="_blank" rel="noopener"><code>nodejs</code></a>，<a href="https://en.softonic.com/download/cmder/windows/post-download" target="_blank" rel="noopener"><code>cmder</code></a>，其中 <a href="https://en.softonic.com/download/cmder/windows/post-download" target="_blank" rel="noopener"><code>cmder</code></a> 是用于代替 <code>cmd</code> ，非必须。<br><strong>点击名字跳转至下载</strong></p>
</blockquote>
<hr>
<h2 id="第一步：准备相应环境"><a href="#第一步：准备相应环境" class="headerlink" title="第一步：准备相应环境"></a>第一步：准备相应环境</h2><h3 id="1-webpack-在-cmd-或-cmder-中完成"><a href="#1-webpack-在-cmd-或-cmder-中完成" class="headerlink" title="1.webpack [ 在 cmd 或 cmder 中完成 ]"></a>1.webpack [ 在 <code>cmd</code> 或 <a href="https://en.softonic.com/download/cmder/windows/post-download" target="_blank" rel="noopener"><code>cmder</code></a> 中完成 ]</h3><div class="code-area-wrap"><div class="highlight-tools"><i class="fa fa-angle-down code-expand" aria-hidden="true"></i><div class="code_lang">java</div></div><figure class="highlight java"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install webpack -g</span><br></pre></td></tr></tbody></table></figure></div>

<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211195505999.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211195505999.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<h3 id="2-vue-在-cmd-或-cmder-中完成"><a href="#2-vue-在-cmd-或-cmder-中完成" class="headerlink" title="2.vue [ 在 cmd 或 cmder 中完成 ]"></a>2.vue [ 在 <code>cmd</code> 或 <a href="https://en.softonic.com/download/cmder/windows/post-download" target="_blank" rel="noopener"><code>cmder</code></a> 中完成 ]</h3><div class="code-area-wrap"><div class="highlight-tools"><i class="fa fa-angle-down code-expand" aria-hidden="true"></i><div class="code_lang">javascript</div></div><figure class="highlight javascript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install vue -g</span><br></pre></td></tr></tbody></table></figure></div>

<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211195705569.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211195705569.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<h3 id="3-vue-cli-在-cmd-或-cmder-中完成"><a href="#3-vue-cli-在-cmd-或-cmder-中完成" class="headerlink" title="3.vue-cli [ 在 cmd 或 cmder 中完成 ]"></a>3.vue-cli [ 在 <code>cmd</code> 或 <a href="https://en.softonic.com/download/cmder/windows/post-download" target="_blank" rel="noopener"><code>cmder</code></a> 中完成 ]</h3><div class="code-area-wrap"><div class="highlight-tools"><i class="fa fa-angle-down code-expand" aria-hidden="true"></i><div class="code_lang">java</div></div><figure class="highlight java"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install vue-cli -g</span><br></pre></td></tr></tbody></table></figure></div>

<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211195814469.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211195814469.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<h3 id="4-vetur-在-VsCode-中完成"><a href="#4-vetur-在-VsCode-中完成" class="headerlink" title="4.vetur  [ 在 VsCode 中完成 ]"></a>4.vetur  [ 在 <a href="https://code.visualstudio.com/docs/?dv=win" target="_blank" rel="noopener"><code>VsCode</code></a> 中完成 ]</h3><blockquote>
<p>按组合键 <strong>Ctrl</strong>+<strong>Shift</strong>+<strong>X</strong> 打开扩展栏，搜索安装 <strong>Vetur</strong></p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211200016131.png?xoss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211200016131.png?xoss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<h2 id="第二布：创建-Vue-工程文件-此阶段均在-VsCode-中完成"><a href="#第二布：创建-Vue-工程文件-此阶段均在-VsCode-中完成" class="headerlink" title="第二布：创建 Vue 工程文件 [ 此阶段均在 VsCode 中完成 ]"></a>第二布：创建 <code>Vue</code> 工程文件 [ 此阶段均在 <a href="https://code.visualstudio.com/docs/?dv=win" target="_blank" rel="noopener"><code>VsCode</code></a> 中完成 ]</h2><blockquote>
<p>我们要用 <a href="https://code.visualstudio.com/docs/?dv=win" target="_blank" rel="noopener"><code>Vscode</code></a> 打开一个文件夹，我们创建的项目工程将存放在这个文件夹下</p>
</blockquote>
<h3 id="1-初始化-创建-工程"><a href="#1-初始化-创建-工程" class="headerlink" title="1.初始化(创建)工程"></a>1.初始化(创建)工程</h3><div class="code-area-wrap"><div class="highlight-tools"><i class="fa fa-angle-down code-expand" aria-hidden="true"></i><div class="code_lang">java</div></div><figure class="highlight java"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vue init webpack your_prj_name <span class="comment">// 工程名不能有大写字母</span></span><br></pre></td></tr></tbody></table></figure></div>

<blockquote>
<p>初始化时会让用户配置一些基本信息，按照自己所需进行选择即可</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211200831753.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211200831753.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<blockquote>
<p>当出现下图状态时表示成功</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/2019121120151067.png?x-os-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/2019121120151067.png?x-os-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<blockquote>
<p>目录结构如图所示</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211201532400.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211201532400.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<blockquote>
<p><strong>注意：</strong> 如果出现下图异常</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211201254714.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211201254714.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<blockquote>
<p>可以打开 <code>PowerShell</code> 的管理员模式，输入 <code>set-ExecutionPolicy RemoteSigned</code> 选择 <code>Y</code> 来解决</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211201448534.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211201448534.png?-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<hr>
<h3 id="2-运行工程"><a href="#2-运行工程" class="headerlink" title="2.运行工程"></a>2.运行工程</h3><blockquote>
<p>明确一点：我们打开的文件夹不是工程文件夹，而是我们初始化时 <code>vue init webpack</code> 后面接的那个文件夹，所以我们首先要打开我们的工程文件夹。在 <a href="https://code.visualstudio.com/docs/?dv=win" target="_blank" rel="noopener"><code>VsCode</code></a> 的终端 <code>Terminal</code> 输入</p>
</blockquote>
<div class="code-area-wrap"><div class="highlight-tools"><i class="fa fa-angle-down code-expand" aria-hidden="true"></i><div class="code_lang">java</div></div><figure class="highlight java"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd your_project_name</span><br></pre></td></tr></tbody></table></figure></div>

<blockquote>
<p>此时我们成功打开工程文件夹，然后继续在 <code>Terminal</code> 输入</p>
</blockquote>
<div class="code-area-wrap"><div class="highlight-tools"><i class="fa fa-angle-down code-expand" aria-hidden="true"></i><div class="code_lang">java</div></div><figure class="highlight java"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm run dev</span><br></pre></td></tr></tbody></table></figure></div>

<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211202235290.png?xoss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211202235290.png?xoss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<blockquote>
<p>出现下图时运行成功</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211202254690.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211202254690.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<blockquote>
<p>此时即可打开链接，访问主页了</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://img-blog.csdnimg.cn/20191211202430260.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" data-fancybox="group" data-caption="在这里插入图片描述" class="fancybox"><img alt="在这里插入图片描述" title="在这里插入图片描述" data-src="https://img-blog.csdnimg.cn/20191211202430260.png?x-ss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0tldmluX0NZX0RMSg==,size_16,color_FFFFFF,t_70" class="lazyload"></a></p>
<h2 id="第三步：-安装更多插件"><a href="#第三步：-安装更多插件" class="headerlink" title="第三步： 安装更多插件"></a>第三步： 安装更多插件</h2><h3 id="1-jQuery敬请期待"><a href="#1-jQuery敬请期待" class="headerlink" title="1.jQuery敬请期待"></a>1.jQuery<code>敬请期待</code></h3><h3 id="2-bootstrap敬请期待"><a href="#2-bootstrap敬请期待" class="headerlink" title="2.bootstrap敬请期待"></a>2.bootstrap<code>敬请期待</code></h3><h3 id="3-iView敬请期待"><a href="#3-iView敬请期待" class="headerlink" title="3.iView敬请期待"></a>3.iView<code>敬请期待</code></h3></body></html></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">Author: </span><span class="post-copyright-info"><a href="mailto:undefined">Cying-承影</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">Link: </span><span class="post-copyright-info"><a href="http://cyingk.github.io/2019/12/12/Init_Vue/">http://cyingk.github.io/2019/12/12/Init_Vue/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">Copyright Notice: </span><span class="post-copyright-info">All articles in this blog are licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> unless stating additionally.</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Vue/">Vue</a></div><div class="post_share"></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-full"><a href="/2019/12/12/What_Is_TypeScript/"><img class="prev-cover" src="https://img-blog.csdnimg.cn/20191212214332469.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">Previous Post</div><div class="prev_info">What's TypeScript</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>Catalog</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link"><span class="toc-number">1.</span> <span class="toc-text">Cying, How To Create A Vue Project ?</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-number">1.1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%9A%E5%87%86%E5%A4%87%E7%9B%B8%E5%BA%94%E7%8E%AF%E5%A2%83"><span class="toc-number">1.2.</span> <span class="toc-text">第一步：准备相应环境</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-webpack-%E5%9C%A8-cmd-%E6%88%96-cmder-%E4%B8%AD%E5%AE%8C%E6%88%90"><span class="toc-number">1.2.1.</span> <span class="toc-text">1.webpack [ 在 cmd 或 cmder 中完成 ]</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-vue-%E5%9C%A8-cmd-%E6%88%96-cmder-%E4%B8%AD%E5%AE%8C%E6%88%90"><span class="toc-number">1.2.2.</span> <span class="toc-text">2.vue [ 在 cmd 或 cmder 中完成 ]</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-vue-cli-%E5%9C%A8-cmd-%E6%88%96-cmder-%E4%B8%AD%E5%AE%8C%E6%88%90"><span class="toc-number">1.2.3.</span> <span class="toc-text">3.vue-cli [ 在 cmd 或 cmder 中完成 ]</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-vetur-%E5%9C%A8-VsCode-%E4%B8%AD%E5%AE%8C%E6%88%90"><span class="toc-number">1.2.4.</span> <span class="toc-text">4.vetur  [ 在 VsCode 中完成 ]</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC%E4%BA%8C%E5%B8%83%EF%BC%9A%E5%88%9B%E5%BB%BA-Vue-%E5%B7%A5%E7%A8%8B%E6%96%87%E4%BB%B6-%E6%AD%A4%E9%98%B6%E6%AE%B5%E5%9D%87%E5%9C%A8-VsCode-%E4%B8%AD%E5%AE%8C%E6%88%90"><span class="toc-number">1.3.</span> <span class="toc-text">第二布：创建 Vue 工程文件 [ 此阶段均在 VsCode 中完成 ]</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E5%88%9D%E5%A7%8B%E5%8C%96-%E5%88%9B%E5%BB%BA-%E5%B7%A5%E7%A8%8B"><span class="toc-number">1.3.1.</span> <span class="toc-text">1.初始化(创建)工程</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E8%BF%90%E8%A1%8C%E5%B7%A5%E7%A8%8B"><span class="toc-number">1.3.2.</span> <span class="toc-text">2.运行工程</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%9A-%E5%AE%89%E8%A3%85%E6%9B%B4%E5%A4%9A%E6%8F%92%E4%BB%B6"><span class="toc-number">1.4.</span> <span class="toc-text">第三步： 安装更多插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-jQuery%E6%95%AC%E8%AF%B7%E6%9C%9F%E5%BE%85"><span class="toc-number">1.4.1.</span> <span class="toc-text">1.jQuery敬请期待</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-bootstrap%E6%95%AC%E8%AF%B7%E6%9C%9F%E5%BE%85"><span class="toc-number">1.4.2.</span> <span class="toc-text">2.bootstrap敬请期待</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-iView%E6%95%AC%E8%AF%B7%E6%9C%9F%E5%BE%85"><span class="toc-number">1.4.3.</span> <span class="toc-text">3.iView敬请期待</span></a></li></ol></li></ol></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="footer_custom_text">却道天凉好个秋</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="Read Mode"><i class="fas fa-book-open"></i></button><button id="font-plus" type="button" title="Increase font size"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="Decrease font size"><i class="fas fa-minus"></i></button><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="Table Of Contents"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="Back To Top"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>if (document.getElementsByClassName('mermaid').length) {
  if (window.mermaidJsLoad) mermaid.init()
  else {
    getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(() => {
      window.mermaidJsLoad = true
      mermaid.initialize({
        theme: 'default',
      })
      false && mermaid.init()
    })
  }
}</script></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>